﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ktcar.Cs.Common.Validations;

namespace KtcAr.Services.Monitors
{
    public class MonitorList
    {
        List<IMonitor> monitors = new List<IMonitor>();

        /// <summary>
        /// Builder de monitors
        /// </summary>
        /// <param name="monitor"></param>
        /// <returns></returns>
        public MonitorList Add(IMonitor monitor)
        {
            this.monitors.Add(monitor);
            return this;
        }

        public List<MonitorResult> CheckAll()
        {
            var results = new List<MonitorResult>();
            monitors.ForEach(m=> results.Add(m.CheckIt()));
            return results;
        }
    }
}
